printf( "Usage:\n RANDLANG [<events_bbs> [<tunes_bbs>]]\n\n<events_bbs> is the name of the events file for Maximus\n(optional, defaults to EVENTS00.BBS). <tunes_bbs> is the name of the\nMaximus \"tunes\" file (optional, defaults to TUNES.BBS).\n" );
exit(0);
}
void GetTunes(void) {
FILE *fp;
char line[MAXLLEN];
if( NULL == (fp = fopen( tunes_bbs, "rt" )) ) {
printf( "Error: tunes file \"%s\" not found\n\n", tunes_bbs );
HelpMe();
}
printf( "Getting tunes from \"%s\"...", tunes_bbs );
num_tunes = 0;
while( !feof( fp ) ) {
fgets( line, MAXLLEN, fp );
if( strnicmp( line, "* Yell", 6 ) == 0 )
tune_nums[num_tunes++] = atoi( &line[6] );
}
fclose( fp );
if( num_tunes == 0 ) {
printf( "\nError: No tunes found in \"%s\"\n\n", tunes_bbs );
HelpMe();
}
printf( "\n" );
}
void WriteNewTune(void) {
FILE *in, *out;
char tmpname[NLEN];
char line[MAXLLEN], *p;
tmpnam( tmpname );
if( NULL == (in = fopen( events_bbs, "rt" )) ) {
printf( "Error: events file \"%s\" not found\n", events_bbs );
HelpMe();
}
if( NULL == (out = fopen( tmpname, "wt" )) ) {
printf( "Error: unable to create temporary file \"%s\"\n", tmpname );